package cn.school.notice.dao;

import cn.school.classManage.vo.SchoolClassVO;
import cn.school.notice.entity.SchoolNotice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SchoolNoticeDao extends BaseMapper<SchoolNotice> {

    /**
     * 根据班级ID查询班级
     * @param classIds
     * @return
     */
    List<SchoolClassVO> findSchoolClassByClassId(@Param("list") List<String> classIds);

    /**
     * 根据年级查询班级
     * @param grade
     * @return
     */
    List<SchoolClassVO> findSchoolClassByGrade(@Param("grade") String grade, @Param("tenantId") String tenantId);

    /**
     * 查询全部班级
     * @return
     */
    List<SchoolClassVO> findSchoolClassAll(@Param("tenantId") String tenantId);


    /**
     * 根据通知ID查询通知的班级
     * @param id
     * @return
     */
    List<String> findNoticeClass(@Param("id")Long id);

    /**
     * 根据通知ID查询通知的年级
     * @param id
     * @return
     */
    List<String> findNoticeGrade(@Param("id")Long id);

    /**
     * 分页查询当前用户的校园通知
     * @param sn
     * @return
     */
    List<SchoolNotice> findSchoolNoticeByUserPageList(@Param("vo") SchoolNotice sn);
    int findSchoolNoticeByUserCount(@Param("vo") SchoolNotice sn);

}
